//
//  ViewController.m
//  UI_Homework_02
//
//  Created by 黄威 on 16/5/11.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "ViewController.h"
#import "ZhuceViewController.h"
#import "ThirdViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createlogin];
    
    
}



-(void)createlogin{
    self.navigationItem.title = @"登录";
    self.view.backgroundColor = [UIColor cyanColor];

    UITextField *textOfname = [[UITextField alloc]initWithFrame:CGRectMake(80, 120, 200, 40)];
    textOfname.placeholder = @"请输入用户名";
    textOfname.backgroundColor = [UIColor purpleColor];
    UITextField *textOfPassword = [[UITextField alloc]initWithFrame:CGRectMake(80, 200, 200, 40)];
    textOfPassword.placeholder = @"请输入密码";
    textOfPassword.backgroundColor = [UIColor purpleColor];
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(120, 300, 100, 60)];
    [button setTitle:@"登录" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor purpleColor];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(handleright)];
    
   
    [button addTarget:self action:@selector(handle) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:textOfPassword];
    [self.view addSubview:textOfname];
    [self.view addSubview:button];
    [textOfname release];
    [textOfPassword release];
    [button release];
    
}
- (void)handle{

    ThirdViewController *third = [[ThirdViewController alloc]init];
    [self.navigationController pushViewController:third animated:YES];


}

- (void)handleright{

    ZhuceViewController *zhuce = [[ZhuceViewController alloc]init];
    
    [self.navigationController pushViewController:zhuce animated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
